<?php


namespace app\index\controller;

use think\Controller;
use app\index\model\Person as personModel;

class Person extends Controller
{
    public function addPerson($name = '111', $age = '18', $sex = '男')
    {
        $person = new personModel();
        $person->name = $name;
        $person->age = $age;
        $person->sex = $sex;
        if ($person->save()) {
            return 'insert success';
        } else return $person->getError();
    }

    public function read()
    {
        $person = personModel::get(1);
        trace('1111');
        return $person;
    }
}